import sequelize from "../../db/dbConnext";
import { option } from "../../db/commomConfig";
import { DataTypes } from "sequelize";
import SysLoginLogEntity from "../../../entities/system/SysLoginLogEntity";

export type ISysDictType = Omit<SysLoginLogEntity, "validateThis" | "id">;

const SysLoginLogModel = sequelize.define<any, ISysDictType>(
  "sys_login_log",
  {
    loginId: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    ipAddr: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    location: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    browser: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    os: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    status: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    remark: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  },
  option
);
export default SysLoginLogModel;
